﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using frag_boardgame;
using WCFCommon;

namespace WCFGameService
{
    // NOTE: If you change the interface name "ILobby" here, you must also update the reference to "ILobby" in App.config.
    [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(ILobbyCallback))]
    public interface ILobby
    {


        [OperationContract(IsInitiating = false, IsTerminating = true)]
        void Disconnect();

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        RoomInfo[] GetRooms();

        [OperationContract(IsInitiating = true, IsTerminating = false)]
        AuthenticationResult Authenticate(string name, string password);

        [OperationContract(IsInitiating = true, IsTerminating = false)]
        AddingNewUserResult AddUser(string name, string password, string email);


        [OperationContract(IsInitiating = true, IsTerminating = false)]
        string Guest_Connection();


        [OperationContract(IsInitiating = false, IsTerminating = false)]
        [FaultContract(typeof(RoomCreationFault))]
        RoomInfo CreateRoom(string name, GameConfiguration config);



        [OperationContract(IsInitiating = false, IsTerminating = false)]
        List<String> GetPlayerHistory(string userName);

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        int GetPlayerScroe(string name);
        
        [OperationContract(IsInitiating = false, IsTerminating = false)]
        List<string> GetPresetBoardsList();
    }

    public interface ILobbyCallback
    {
        [OperationContract(IsOneWay = true)]
        void CheckClient();

        [OperationContract(IsOneWay = true)]
        void Write(string text);

    }


}
